package cx.zan.service;

import cx.zan.dao.UserDao;
import cx.zan.domain.User;

import java.sql.SQLException;

/**
 * @author Mxb
 * @version 1.0
 * @date 2020/3/30 19:07
 */
public class UserService {
    //创建userDao对象
    private UserDao userDao = new UserDao();

    public int saveUser(User user) throws SQLException {
        //调用userDao 对象执行方法
        int i = userDao.saveUser(user);
        return i;
    }

    public User login(String username,String password)  {
        //调用userDao 对象执行方法
        User user = userDao.login(username, password);
        return user;
    }
}
